{% extends "base.html" %}
{% block page_content %}

    <div class="page-header">
        <h1>Page {{ page }}</h1>
    </div>

    <div>
        {{ wtf.quick_form(form) }}
    </div>

    <div>
    <ul>
    {% for entry in entries_for_page %}
        <li><p><a href="{{ url_for('main.view_entries_for_day', day=entry['timestamp'][:10], _external=True) }}">{{ entry['timestamp'][:10] }}</a> at <a href="{{ url_for('main.view_single_entry', timestamp=entry['timestamp'], _external=True) }}">{{ entry['timestamp'][11:] }}</a>:</br>{{entry['entry']}}</br>
        Tags:
            {% if entry['tags']|length != 0 %}
                {% for tag in entry['tags'] %}
                    <a href="{{ url_for('main.view_entries_for_tag', tag=tag, _external=True) }}">#{{ tag }}</a>
                {% endfor %}
            {% else %}
                none
            {% endif %}
            </p></li>
    {% endfor %}
    </ul>
    </div>
    </br>
    <div>
        <p class="right-link">{% if prev_page %}<a class="btn btn-default" href="{{ url_for('main.view_entries_for_page', page=prev_page, _external=True) }}">Newer entries</a>{% else %} {% endif %}</p>
        <p>{% if next_page %}<a class="btn btn-default" href="{{ url_for('main.view_entries_for_page', page=next_page, _external=True) }}">Older entries</a>{% else %}<span class="btn btn-default" id="placeholder">_</span>{% endif %}</p>
    </div>

{% endblock %}